package com.jxw.launcher;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.Window;

/* loaded from: classes.dex */
public class BaseActivity extends FragmentActivity {
    private Handler mRestoreImmersiveModeHandler = new Handler();
    private Runnable restoreImmersiveModeRunnable = new Runnable() { // from class: com.jxw.launcher.BaseActivity.3
        @Override // java.lang.Runnable
        public void run() {
            BaseActivity.this.restoreTransparentBars();
        }
    };

    /* JADX INFO: Access modifiers changed from: private */
    public void restoreTransparentBars() {
    }

    public void initInfoView() {
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // android.support.v4.app.FragmentActivity, android.support.v4.app.SupportActivity, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        requestWindowFeature(1);
        View decorView = getWindow().getDecorView();
        if (Build.VERSION.SDK_INT >= 21) {
            Window window = getWindow();
            window.clearFlags(201326592);
            window.getDecorView().setSystemUiVisibility(1792);
            window.addFlags(Integer.MIN_VALUE);
            window.setStatusBarColor(0);
            window.setNavigationBarColor(0);
        } else if (Build.VERSION.SDK_INT >= 19) {
            getWindow().addFlags(67108864);
            getWindow().addFlags(134217728);
        }
        decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { // from class: com.jxw.launcher.BaseActivity.1
            @Override // android.view.View.OnSystemUiVisibilityChangeListener
            public void onSystemUiVisibilityChange(int i) {
                BaseActivity.this.restoreTransparentBars();
            }
        });
        decorView.setOnFocusChangeListener(new View.OnFocusChangeListener() { // from class: com.jxw.launcher.BaseActivity.2
            @Override // android.view.View.OnFocusChangeListener
            public void onFocusChange(View view, boolean z) {
                BaseActivity.this.restoreTransparentBars();
            }
        });
        startMediaService();
    }

    @Override // android.support.v4.app.FragmentActivity, android.app.Activity
    public void onResume() {
        restoreTranslucentBarsDelayed();
        MyApp.getInstance().mBottomBtnOnClickListener.setContext(this);
        super.onResume();
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        restoreTranslucentBarsDelayed();
    }

    public void restoreTranslucentBarsDelayed() {
        restoreTransparentBars();
        this.mRestoreImmersiveModeHandler.postDelayed(this.restoreImmersiveModeRunnable, 500L);
    }

    private void startMediaService() {
        Intent intent = new Intent();
        intent.setClassName("com.jxw.launcher", "com.jxw.system.mediaserver.JhtMediaService");
        startService(intent);
    }
}
